package br.com.company.myproject.presentation;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Controller;

import br.com.company.myproject.domain.Menu_old;
import br.com.company.myproject.domain.SubMenu_old;

@Controller
public class HomeController {

	public List<Menu_old> getAllMenu() {
		System.out.println("Teste2");

		Menu_old menu = null;
		SubMenu_old submenu = null;
		SubMenu_old submenu2 = null;
		SubMenu_old submenu3 = null;

		List<Menu_old> menus = new ArrayList<Menu_old>();

		menu = new Menu_old();
		menu.setId(1);
		menu.setName("Teste 1");
		submenu = new SubMenu_old();
		submenu.setId(1);
		submenu.setName("Sub 1");
		List<SubMenu_old> submenus = new ArrayList<SubMenu_old>();
		submenus.add(submenu);
		menu.setSubmenu(submenus);
		menus.add(menu);

		return menus;

/*		menu = new Menu();
		menu.setId(2);
		menu.setName("Teste 2");
		menus.add(menu);

		menu = new Menu();
		menu.setId(3);
		menu.setName("Teste 3");
		submenu2 = new SubMenu();
		submenu2.setId(2);
		submenu2.setName("Sub 2");
		submenus = new ArrayList<SubMenu>();
		submenus.add(submenu2);
		submenus.add(submenu);
		menu.setSubmenu(submenus);
		menus.add(menu);

		menu = new Menu();
		menu.setId(4);
		menu.setName("Teste 4");
		submenu3 = new SubMenu();
		submenu3.setId(3);
		submenu3.setName("Sub 3");
		submenus = new ArrayList<SubMenu>();
		submenus.add(submenu2);
		submenus.add(submenu);
		submenus.add(submenu3);
		menu.setSubmenu(submenus);
		menus.add(menu);

		menu = new Menu();
		menu.setId(5);
		menu.setName("Teste 5");
		menus.add(menu);

		menu = new Menu();
		menu.setId(6);
		menu.setName("Teste 6");
		menus.add(menu);

		menu = new Menu();
		menu.setId(7);
		menu.setName("Teste 7");
		menus.add(menu);

		menu = new Menu();
		menu.setId(8);
		menu.setName("Teste 8");
		menus.add(menu);

		//return menus;
		return null;
*/
	}

	public String loadHomeAction() {
		System.out.println("Teste1");

		return "success";
	}
}
